import axios from "~/http/request"

// 加载系统内所有的告警topic
export const loadTopicsReq = () => {
  return axios({
    url: "/rpan-authority/topic/getAll",
    method: "get",
  })
}

// 获取系统内所有的用户列表
export const loadAllUsersReq = () => {
  return axios({
    url: "/rpan-authority/admin/usersList",
    method: "get",
  })
}

// 根据topic获取设置有告警接收权限的用户列表
export const loadUserByTopic = (str) => {
  return axios({
    url: "/rpan-authority/topic/query/userList",
    method: "post",
    data: {
      topic: str
    }
  })
}

// 保存告警topic接收的用户
export const saveTopicSetting = (param) => {
  return axios({
    url: "/rpan-authority/topic/save/userList",
    method: "post",
    data: param
  })
}